package com.pomr.controller.simmessage;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.pomr.util.common.SIMConnection;
import com.pomr.util.communication.Communication;
import com.pomr.util.communication.cx211.CX211Back;
import com.pomr.util.communication.cx211.CX211Param;
import com.pomr.util.communication.cx215.CX215Back;
import com.pomr.util.communication.cx215.CX215Param;
import com.pomr.util.communication.cx216.CX216Back;
import com.pomr.util.communication.cx216.CX216Param;
import com.pomr.util.communication.cx217.CX217Back;
import com.pomr.util.communication.cx217.CX217Param;
import com.pomr.util.communication.cx218.CX218Back;
import com.pomr.util.communication.cx218.CX218Param;
import com.pomr.util.communication.cx221.CX221Back;
import com.pomr.util.communication.cx221.CX221Param;

/**
 * 
 * 类名称： SIMMessController
 * 创建人： Administrator
 * 创建时间：2018年5月8日 上午1:03:27
 * 类表述：SIM卡接口调用
 */
@Controller
@RequestMapping("/simMess")
public class SIMMessController {
	
	@RequestMapping(value="/cx211",method=RequestMethod.POST)
	@ResponseBody
	public Communication CX211(@RequestBody CX211Param param) throws Exception{
//			String paramStr = SIMConnection.getParam(param.toMap());
			String url = "http://api.cmpyun.com/api/serviceAccept/findCardInfo";
			return (Communication) CX211Back.fromJson(SIMConnection.mainMessage(param, url));
	}
	
	@RequestMapping(value="/cx215",method=RequestMethod.POST)
	@ResponseBody
	public Communication CX215(@RequestBody CX215Param param) throws Exception{
//			String paramStr = SIMConnection.getParam(param.toMap());
			String url = "http://api.cmpyun.com/api/serviceAccept/findCardInfoList";
			return (Communication) CX215Back.fromJson(SIMConnection.mainMessage(param, url));
	}
	
	@RequestMapping(value="/cx216",method=RequestMethod.POST)
	@ResponseBody
	public Communication CX216(@RequestBody CX216Param param) throws Exception{
//			String paramStr = SIMConnection.getParam(param.toMap());
			String url = "http://api.cmpyun.com/api/serviceAccept/findCardMonthUseDataInfo";
			return (Communication) CX216Back.fromJson(SIMConnection.mainMessage(param, url));
	}
	
	@RequestMapping(value="/cx217",method=RequestMethod.POST)
	@ResponseBody
	public Communication CX217(@RequestBody CX217Param param) throws Exception{
//			String paramStr = SIMConnection.getParam(param.toMap());
			String url = "http://api.cmpyun.com/api/serviceAccept/cardBeforeSixMonthInfo";
			return (Communication) CX217Back.fromJson(SIMConnection.mainMessage(param, url));
	}
	
	@RequestMapping(value="/cx218",method=RequestMethod.POST)
	@ResponseBody
	public Communication CX218(@RequestBody CX218Param param) throws Exception{
//			String paramStr = SIMConnection.getParam(param.toMap());
			String url = "http://api.cmpyun.com/api/serviceAccept/cardRechargeInfo";
			return (Communication) CX218Back.fromJson(SIMConnection.mainMessage(param, url));
	}
	
	@RequestMapping(value="/cx221",method=RequestMethod.POST)
	@ResponseBody
	public Communication CX221(@RequestBody CX221Param param) throws Exception{
//			String paramStr = SIMConnection.getParam(param.toMap());
			String url = "http://api.cmpyun.com/api/serviceAccept/cardStatusChange";
			return (Communication) CX221Back.fromJson(SIMConnection.mainMessage(param, url));
	}

}
